package server;

/*
生命周期接口,用于监控实现该接口类的启动前、启动、启动后、关闭前、关闭、关闭后行为
当发生响应行为后,会将行为包装成LifecycleEvent传递到该类的所有监听器上
*/
/*
2023/2/7 该接口内容全部写完,后续直接使用,无需修改
by cyl
 */
public interface Lifecycle {
    public static final String START_EVENT = "start";
    public static final String BEFORE_START_EVENT = "before_start";
    public static final String AFTER_START_EVENT = "after_start";
    public static final String STOP_EVENT = "stop";
    public static final String BEFORE_STOP_EVENT = "before_stop";
    public static final String AFTER_STOP_EVENT = "after_stop";

    public void addLifecycleListener(LifecycleListener listener);
    public LifecycleListener[] findLifecycleListeners();
    public void removeLifecycleListener(LifecycleListener listener);
    public void start() throws LifecycleException;
    public void stop() throws LifecycleException;
}
